package self.wargon.springcloudstu.gateway.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

public class UserRouteFilter implements GatewayFilter {

    private static final Logger log = LoggerFactory.getLogger(UserRouteFilter.class);

    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
        String path = exchange.getRequest().getPath().toString();
        log.info("👤 [UserRouteFilter] 请求路径: {}", path);

        // 你可以在这里添加 Header、鉴权、限流等逻辑
        return chain.filter(exchange);
    }
}
